package com.fan.shop.services;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import org.springframework.transaction.annotation.Transactional;

import com.fan.shop.dao.ShopGlobalDao;
import com.fan.shop.domain.ShopGlobal;

@Named("shopGlobalService")
@Transactional(readOnly = true)
public class ShopGlobalServiceImpl implements ShopGlobalService {

	@Inject
	@Named("shopGlobalDao")
	private ShopGlobalDao shopGlobalDao;
	
	@SuppressWarnings("rawtypes")
	public List getList() {
		return shopGlobalDao.getAllShopGlobals();
	}

	public int getColumnsSize() {
		return shopGlobalDao.getColumnNames().size();
	}

	public Object copy(Object obj) {
		return null;
	}

	public ShopGlobal getShopGlobal(String name) {
		return shopGlobalDao.getShopGlobal(name);
	}

	public List<ShopGlobal> getAllShopGlobals() {
		return shopGlobalDao.getAllShopGlobals();
	}

	public int getSize() {
		return shopGlobalDao.getSize();
	}

	@Transactional(readOnly = false)
	public void addShopGlobal(ShopGlobal shopGlobal) {
		shopGlobalDao.addShopGlobal(shopGlobal);
	}

	@Transactional(readOnly = false)
	public void updateStock(ShopGlobal shopGlobal) {
		shopGlobalDao.updateStock(shopGlobal);
	}

	@Transactional(readOnly = false)
	public void deleteShopGlobal(ShopGlobal shopGlobal) {
		shopGlobalDao.deleteShopGlobal(shopGlobal);
	}

	public boolean hasShopGlobal(String name) {
		return shopGlobalDao.hasShopGlobal(name);
	}

	public List<String> getColumnNames() {
		return shopGlobalDao.getColumnNames();
	}

}
